# Maintainer: Sergej Pupykin <arch+pub@sergej.pp.ru>
# Montainer: 3ED <krzysztof1987 at gmail dot com>
#

pkgname=perl-eval-closure
_lastauthor=D/DO/DOY
_pkgname=Eval-Closure
pkgver=0.14
pkgrel=9
pkgdesc="safely and cleanly create closures via string eval"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-try-tiny' 'perl-sub-exporter')
checkdepends=('perl-test-requires' 'perl-test-fatal' 'perl-test-output')
url="https://metacpan.org/release/${_pkgname}"
source=(https://cpan.metacpan.org/authors/id/${_lastauthor}/${_pkgname}-${pkgver}.tar.gz)
sha256sums=('ea0944f2f5ec98d895bef6d503e6e4a376fea6383a6bc64c7670d46ff2218cad')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL="--skipdeps" \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='"$pkgdir"'" \
    PERL_MB_OPT="--installdirs vendor --destdir '"$pkgdir"'" \
    MODULEBUILDRC=/dev/null

  cd "${srcdir}/${_pkgname}-${pkgver}"
  perl Makefile.PL
  make
}
check() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  make test
}
package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  make install
}
